<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // cookie

    var date = new Date();
    date.setMinutes(date.getMinutes() + 30);

    document.cookie = "oUser=haha123;expires=" + date.toUTCString() + ";path=/";

    // console.log(document.cookie);  // 取值 => 拆分解析 (1.对应键名  2. 放到对象中)
    // var a = "cookie"
    // console.log(document["cookie"]);

</script>

</html>